<script setup lang="ts">
import { loginStore } from '@/stores/login'
import { onBeforeMount } from 'vue'
import { useRouter, useRoute } from 'vue-router'

const store = loginStore()
const router = useRouter()
const route = useRoute()


onBeforeMount(()=>{
  console.log(route.query)
})

//提交登陆表单
const submitForm = async() => {
  await store.setToken('t-001', '2024-11-10', 'r-001', '2025-11-10')
  await store.setUser(1, '001', 'Jim', '1233333')
  router.push({name:'Home'})
}

</script>

<template>
  <el-button type="primary" @click="submitForm">登陆</el-button>
</template>